package cn.itcast.hotel.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @description:
 * @author: HotelEs
 * @time: 2022/6/16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "hotel_es",shards = 3,replicas = 1)
public class HotelEs {

    @Id
    @Field(type = FieldType.Long)
    private Long id;
    @Field(type = FieldType.Text,analyzer = "ik_max_word",store = true)
    private String name;
    @Field(type = FieldType.Double,index = true,store = true)
    private Integer price;
    @Field(type = FieldType.Keyword,index = true,store = true)
    private String brand;
    @Field(type = FieldType.Keyword,index = true,store = true)
    private String city;

}
